﻿using System.IO;
using System.Linq;
using Codingly.SvnExternalUpdater.Model;
using System;

namespace Codingly.SvnExternalUpdater.Services
{
    public class CommandLineConfigurationService : IConfigurationService
    {
        #region IConfigurationService Members

        public MonitorConfiguration GetConfiguration()
        {
            var configuration = new MonitorConfiguration();
            configuration.Projects.AddRange(Environment.GetCommandLineArgs().Where(Directory.Exists));
            return configuration;
        }

        public void SaveConfiguration(MonitorConfiguration configuration)
        {
            // empty cause there's nothing to save
        }

        #endregion
    }
}